package com.dk.hi.core.helper;

import org.newdawn.slick.geom.Circle;

import com.dk.hi.core.BlockMap;
import com.dk.hi.core.Settings;

/**
 * Helper for Map management
 */
public class MapHelper {
	public static Circle ACTION_CIRCLE = new Circle(Settings.WINDOW_WIDTH / 2 + 16, Settings.WINDOW_HEIGHT / 2 + 16, Settings.ACTION_RANGE);
	public static Circle RECON_CIRCLE = new Circle(Settings.WINDOW_WIDTH / 2 + 16, Settings.WINDOW_HEIGHT / 2 + 16, Settings.RECON_RANGE);

	/**
	 * Gets the Map x coordinate of a screen x coordinate
	 * 
	 * @param map
	 *            - the map
	 * @param x
	 *            - the x coordinate
	 * @return the map x coordinate
	 */
	public static Integer getMapX(BlockMap map, Integer x) {
		return x - map.getX();
	}

	/**
	 * Gets the Map y coordinate of a screen y coordinate
	 * 
	 * @param map
	 *            - the map
	 * @param y
	 *            - the y coordinate
	 * @return the map y coordinate
	 */
	public static Integer getMapY(BlockMap map, Integer y) {
		return y - map.getY();
	}

	/**
	 * Gets the screen x coordinate of a map x coordinate
	 * 
	 * @param map
	 *            - the map
	 * @param x
	 *            - the x coordinate
	 * @return the x screen coordinate
	 */
	public static Integer getScreenX(BlockMap map, Integer x) {
		return x - map.getX();
	}

	/**
	 * Gets the screen y coordinate of a map y coordinate
	 * 
	 * @param map
	 *            - the map
	 * @param y
	 *            - the y coordinate
	 * @return the y screen coordinate
	 */
	public static Integer getScreenY(BlockMap map, Integer y) {
		return y - map.getY();
	}
}
